﻿using Cl.Entity.DataBaseEntity.User;
using Cl.Utils.Primitives.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cl.Model.DataBaseEntityDtos.User.Permissions
{
    public class PermissionOutDto
    {
        public PermissionOutDto()
        {

        }

        public PermissionOutDto(Permission x)
        {
            id = x.Id;
            parentId = x.ParentId;
            path = x.Path;
            name = x.Name;
            viewPath = x.Path;
            redirect = x.Redirect;
            label = x.Label;
            icon = x.Icon;
            opened = x.Opened;
            newWindow = x.NewWindow;
            external = false;
            isKeepAlive = false;
            isAffix = x.IsAffix;
            isIframe = x.IsIframe;
            link = x.Link;
            type = x.Type;
        }
        public int id { get; set; }

        public int? parentId { get; set; }
        public string path { get; set; } = string.Empty;
        public string name { get; set; } = string.Empty;
        public string viewPath { get; set; } = string.Empty;
        public string redirect { get; set; } = string.Empty;
        public string label { get; set; } = string.Empty;
        public string icon { get; set; } = string.Empty;
        public bool opened { get; set; } = false;
        public bool newWindow { get; set; } = false;
        public bool external { get; set; } = false;
        public bool isKeepAlive { get; set; } = false;
        public bool isAffix { get; set; } = false;
        public bool isIframe { get; set; } = false;

        public string link { get; set; } = string.Empty;
        public PermissionType type { get; set; }
    }
}
